package app.controllers.admin.stat;

import app.models.wx.ReceiveMessage;
import com.github.sog.controller.BasicController;
import com.github.sog.controller.datatables.core.DatatablesCriterias;
import com.jfinal.plugin.activerecord.Page;

/**
 * <p>
 * .
 * </p>
 *
 * @author Jerry Ou
 * @version 1.0 2014-04-24 00:04
 * @since JDK 1.6
 */
public class RecemsgController extends BasicController {

    public void index() {
        render("index.ftl");
    }

    public void list() {
        final DatatablesCriterias criterias = getCriterias();
        Page<ReceiveMessage> page = ReceiveMessage.dao.datatable(criterias);

        renderDataTables(page, criterias);
    }

    public void detail() {
        long id = getParaToLong("id", 0l);
        ReceiveMessage message = ReceiveMessage.dao.findById(id);
        setAttr("message", message);
        render("detail.ftl");
    }
}
